public class Interval{
	public final double le;
	public final double ri;
	
	public Interval(double left, double right){
		le = left;
		ri = right;
	}
	
	//Notkun: c = a.contains(x)
	//Fyrir: ekkert
	//Eftir: c er true ef x er á bilinu a, annars false
	public boolean contains(double x){
		boolean isinint;
		isinint = ((x>=le)&&(x<=ri));
		return isinint;
	}	
	
	//Notkun: c = a.intersects(b)
	//Fyrir: ekkert
	//Eftir: c er true ef a og b skerast, annars ekki (háð skilgreiningunni að tómt bil sker öll bil)
	public boolean intersects(Interval b){
		boolean isintersect;
		isintersect = ((b.le <= ri)&&(b.le >=le)) || ((b.ri<=ri)&&(b.ri>=le))
		|| ((b.ri>=ri) && (b.le<=le));
		return isintersect;
	}
	
	//Notkun: s = a.toString()
	//Fyrir: ekkert
	//Eftir: s er strengurinn le til ri
	public String toString(){
		String s;
		s=le+" til "+ri;
		return s;
	}
	
	public static void main(String[] args){
		double x = Double.parseDouble(args[0]);
		while(!StdIn.isEmpty()){
			double left;
			double right;
			left = StdIn.readDouble();
			right = StdIn.readDouble();
			Interval Nint = new Interval(left, right);
			
			if(Nint.contains(x)==true){
				String S;
				S=Nint.toString();
				System.out.println(S);
			}
		}
	}
}